<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<html>
<head>
    <title>活动管理</title>
    <script type="text/javascript" src="${ctx}/static/myJs/util.js"></script>
    <script type="text/javascript" src="${ctx}/static/myJs/activityController.js"></script>
    <link href="${ctx}/static/datetimepicker/bootstrap/css/bootstrap-datetimepicker.min.css" rel="stylesheet"
          media="screen">
    <script type="text/javascript" src="${ctx}/static/datetimepicker/jquery/bootstrap-datetimepicker.js"
            charset="UTF-8"></script>
    <script type="text/javascript" src="${ctx}/static/datetimepicker/jquery/locales/bootstrap-datetimepicker.zh-CN.js"
            charset="UTF-8"></script>
</head>

<body>
<div class="content">

    <div class="page-subcate-list">
        <div class="page-subcate-item">
            <label>活动时间</label>

            <div class="form-item">
                <div id="inputStartDate" class="input-group date form_date col-md-1" data-date=""
                     data-date-format="yyyy-mm-dd"
                     data-link-field="dtp_input2" data-link-format="yyyy-mm-dd">
                    <input class="form-control" size="16" type="text" id="startDate" value="" readonly>
                    <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
                    <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
                </div>
                <input type="hidden" id="dtp_input2" value=""/>


                <div id="inputEndDate" class="input-group date form_date col-md-1" data-date=""
                     data-date-format="yyyy-mm-dd"
                     data-link-field="dtp_input3" data-link-format="yyyy-mm-dd">
                    <input class="form-control" size="16" type="text" id="endDate" value="" readonly>
                    <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
                    <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
                </div>
                <input type="hidden" id="dtp_input3" value=""/>
            </div>
            <label>活动名称</label>

            <div class="form-item">
                <input type="text" class="form-control" id="title" placeholder="" value="">

                <div class="pull-right">
                    <button onclick="javascript:searchActivity();" class="pull-left btn">查询</button>

                    <button class="pull-left btn" onclick="pubActivity('${ctx}/activity/pubSingle');">
                        <i class="fa fa-plus" aria-hidden="true"></i>
                        发布活动
                    </button>
                    <!--
                    <button class="pull-left btn"><i class="fa fa-plus" aria-hidden="true"></i>发布定期活动</button>
                    -->
                </div>
            </div>
        </div>
        <!--
        <div class="page-subcate-item">
            <label>活动标签</label>
            <ul class="choices">
                <li><a href="#">XXXXX</a></li>
                <li><a href="#">XXXXX</a></li>
                <li><a href="#">XXXXX</a></li>
                <li><a href="#">XXXXX</a></li>
            </ul>
            <span class="more">
                <a href="#">更多 <i class="fa fa-angle-down" aria-hidden="true"></i></a>
            </span>
        </div>
        -->
    </div>


    <table class="table table-bordered">
        <thead>
        <tr>
            <th>名称</th>
            <th>状态</th>
            <th>开始时间</th>
            <th>结束时间</th>
            <!--
            <th>报名数</th>
            <th>参加人次</th>
            -->
            <th>公益时间(分钟)</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${data.content}" var="item" varStatus="status">
            <tr id="${item.activityCode}">
                <td>${item.name}</td>
                <td>
                    <c:if test="${item.actStatus==1}"><font color="red">内部招募</font></c:if>
                    <c:if test="${item.actStatus==2}"><font color="green">外部招募</font></c:if>
                    <c:if test="${item.actStatus==3}"><font color="blue">进行中</font></c:if>
                    <c:if test="${item.actStatus==4}"><font color="blue">已结束</font></c:if>
                    <c:if test="${item.actStatus==5}"><font color="blue">已取消</font></c:if>
                    <c:if test="${item.actStatus==6}"><font color="blue">已封存</font></c:if>
                </td>
                <td>${item.startTime}</td>
                <td>${item.endTime}</td>
                <!--
                <td>${item.applys}</td>
                <td>${item.attends}</td>
                -->
                <td>${item.times}</td>

                <td align="center">

                    <a href="${ctx}/activity/detail/${item.activityCode}" class="table-action">
                        <i class="fa fa-eye"aria-hidden="true"></i>
                    </a>

                    <c:if test="${item.actStatus==1 || item.actStatus==2}">
                        <a href="${ctx}/activity/update/${item.activityCode}" class="table-action">
                            <i class="fa fa-pencil"aria-hidden="true"></i>
                        </a>
                        <a href="javascript:void(0);" onclick="javascript:del('${item.activityCode}');"
                           class="table-action">
                            <i class="fa fa-trash" aria-hidden="true"></i>
                        </a>
                    </c:if>
                </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
    <tags:pagination page="${data}" paginationSize="5"/>
</div>
<script type="text/javascript">
    $('#inputStartDate').datetimepicker({
        language: 'zh-CN',
        weekStart: 1,
        todayBtn: 1,
        autoclose: 1,
        todayHighlight: 1,
        startView: 2,
        minView: 2,
        forceParse: 0
    });
    $('#inputEndDate').datetimepicker({
        language: 'zh-CN',
        weekStart: 1,
        todayBtn: 1,
        autoclose: 1,
        todayHighlight: 1,
        startView: 2,
        minView: 2,
        forceParse: 0
    });
</script>

</body>
</html>
